package com.teng.mylibrary.ui.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * Description:    FaragmentAdapter
 * Author:         liuteng
 * CreateDate:     2021年11月30日
 * UpdateRemark:   更新说明
 */
class FragmentPageAdapter(
    fragmentActivity: FragmentActivity,
    private val fragments: List<Fragment>
) :
    FragmentStateAdapter(fragmentActivity) {

    override fun getItemCount(): Int {
        return fragments.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragments[position]
    }

}